from app.services.business.gaolu_diagnose.ind.abstract_ind import AbstractInd


class CG_LT_GL_GL04_Yuanranliao_Ore_V2O5(AbstractInd):
    def get_name(self):
        return "CG_LT_GL_GL04_Yuanranliao_Ore_V2O5"

    def get_data_source(self):
        return "mysql"

    def get_db(self):
        return "ironman"

    def get_sql(self, params):
        sql_ore_V2O5 = """   
                SELECT
                CG_LT_GL_GL04_Yuanranliao_Ore_V2O5 AS CG_LT_GL_GL04_Yuanranliao_Ore_V2O5            
                FROM cg_lt_gl04_hanfan_predict
                WHERE datetime > DATE_SUB(CURTIME(), INTERVAL 5 hour) 

                ORDER BY datetime DESC LIMIT 1
                """.format(**params)

        return sql_ore_V2O5
